<script type="text/javascript" src="./src/js/jquery.form.js"></script>
<script>
$(document).ready(function() {
	$('#ajaxuploadimg').click(function () {
		$('#uploadFile1').click();
    });
	$("#uploadFile1").change(function () { //选择文件 
        $("#myupload").ajaxSubmit({
            success: function (url) { //成功 
            	var f = url.split(';;');
    			if(f[0] == '0'){
    				alert('上传出错了,请重新上传');
    			}else{
    				$('#picurl').attr("value",f[0]);
    				$('#picshow').html('');
    				$('#picshow').html('<img width="300" src="'+f[0]+'" />');
    			}
            }
        });
    });
});
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="guide">
	<tr>
		<td>
			<span style="float: left;">后台管理中心&nbsp;&raquo;&nbsp;圈子功能</span>
			<span style="float: right;">
				<a href="javascript:history.go(-1);">&lt;- 返回</a>
			</span>
		</td>
	</tr>
</table>

<form action="./?controller=circle&action=doaddetail" method="post">
<input type="hidden" name="id" value="<?php echo $this->data['id'];?>" />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
	<tr>
		<td class="altbg1">类型</td>
		<td class="altbg2">
			<select name="type">
<?php 
foreach ($this->type_data as $k=>$v){
    $selected = (int)$this->data['type'] == $k ? 'selected' : '';
    echo '<option '.$selected.' value="'.$k.'">'.$v.'</option>';
}
?>
			</select>
		</td>
	</tr>
	<tr>
		<td class="altbg1">上传图片</td>
		<td class="altbg2">
			<img id="ajaxuploadimg" src="./src/img/upload.png" />
			<input type="hidden" name="img_url" value="<?php echo $this->data['img_url']; ?>" id="picurl">
		</td>
	</tr>
	<tr>
		<td class="altbg1">预览图片</td>
		<td class="altbg2">
			<div id="picshow">
				<?php if (isset($this->data['img_url'])){ echo '<img width="300" src="'.DOMAIN.$this->data['img_url'].'" />';}?>
			</div>
		</td>
	</tr>
	<tr>
		<td class="altbg1">显示链接</td>
		<td class="altbg2">
			<input class="input" name="link" value="<?php echo $this->data['link'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1">排序</td>
		<td class="altbg2">
			<input class="input" name="rank" value="<?php echo $this->data['rank'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1" colspan=2 align="center">
			<input class="button" type="submit" value="确定" />
			&nbsp;
			<input class="button" type="reset" value="重置" />
		</td>
	</tr>
</table>
</form>

<div style="display:none;">
    <form id="myupload" action="./" method="post" enctype="multipart/form-data">
        <input type="file" id="uploadFile1" name="file" runat="server" />
        <input type="hidden" name="controller" value="upload" />
        <input type="hidden" name="action" value="index" />
    </form>
</div>

